﻿<%@ Page Title="" Language="C#" MasterPageFile="~/ChuyenMucPage.master" AutoEventWireup="true"
    CodeFile="ChuyenMucND.aspx.cs" Inherits="ChuyenMucND" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ChuyenMucHead1" runat="Server">
    <title>
        <asp:Literal ID="ltrTitle" runat="server"></asp:Literal>
        -
        <%= Common.title %>
    </title>
    <asp:Literal ID="litnoidung" runat="server"></asp:Literal>
    <link href="../../../CSS/style-chuyenmuc-nd.css" rel="stylesheet" type="text/css" />
    <link href="../../../CSS/StyleServices.css" rel="stylesheet" type="text/css" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ChuyenMucContent1" runat="Server">
    <div id="backgroundPopup">
    </div>
    <div class="popup_email" id="popup_email" style="position: fixed; z-index: 1000;
        top: 49px; left: 431.5px; display: none;">
        <div class="title_popup">
            <div class="left" style="float: left; width: 50%;">
                Email</div>
            <div class="right" style="float: right;">
                <a href="javascript:;" onclick="news_detail.disablePopup();">
                    <img class="close-btn" alt="" src="images/dltn/close-btn.gif">
                </a>
            </div>
            <div class="clear">
                &nbsp;</div>
        </div>
        <div class="content_popup_email">
            <table class="pop_email" id="pop_email">
                <tr>
                    <td class="w140 txt_gray txt_right" style="padding-top: 15px;">
                        <b>Email của bạn</b>
                    </td>
                    <td class="w400">
                        <asp:TextBox ID="txtFromEmail" runat="server" class="w360"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="w140 txt_gray txt_right" style="padding-top: 15px;">
                        <b>Tên của bạn</b>
                    </td>
                    <td class="w400">
                        <asp:TextBox ID="txtTen" runat="server" class="w360"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="w140 txt_gray txt_right" style="padding-top: 15px;">
                        <b>Gửi đến(To)</b>
                    </td>
                    <td class="w400">
                        <asp:TextBox ID="txtToEmail" runat="server" class="w360"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="w140 txt_gray txt_right" style="padding-top: 15px;">
                        <b>Tiêu đề(Subject)</b>
                    </td>
                    <td class="w400">
                        <asp:TextBox ID="txtTieuDe" runat="server" class="w360"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="w140 txt_gray txt_right">
                        <b>Thông điệp<br />
                            (Message)</b>
                    </td>
                    <td class="w400">
                        <asp:TextBox ID="txtThongDiep" runat="server" TextMode="MultiLine" class="w360 h100"
                            Width="352px"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="w140 txt_gray txt_right">
                        &nbsp;
                    </td>
                    <td class="w400">
                        <asp:ImageButton ID="cmdSendMail" runat="server" OnClick="cmdSendMail_Click" ImageUrl="~/Images/Send.jpg"
                            Style="float: left;" />
                    </td>
                </tr>
            </table>
        </div>
    </div>
    <script language="javascript">
        var news_detail = {
            other_article_id: 0,
            other_limit: 0,
            othernews_next: function (param) {
                var box = $("#othernews_paging");
                // get article_id && limit 
                var artical_id = (this.other_article_id == 0) ? $("#article_id").val() : this.other_article_id;
                var limit = (this.other_limit == 0) ? $("#limit_other_news").val() : this.other_limit;
                // next event

                box.find(".NextPage_Folder").live("click", function () {
                    box.find(".show_other_news").empty();
                    $("#load").show();
                    var param = {
                        flagExc: $(this).attr("data-flagex"),
                        intCate: $(this).attr("data-cateid"),
                        intThumb: $(this).attr("data-numberthumb"),
                        intPage: parseInt($(this).attr("data-page")) + 1,
                        intLimit: limit,
                        article_id: artical_id,
                        offset: $(this).attr("data-offset")
                    };
                    // post data
                    $.post(base_url + '/detail/othernews', param, function (data) {
                        box.find(".show_other_news").html(data.html);
                        $("#load").hide();
                    }, "json");
                });
                // prev event
                box.find(".prvPage_Folder").live("click", function () {
                    box.find(".show_other_news").empty();
                    $("#load").show();
                    var param = {
                        flagExc: $(this).attr("data-flagex"),
                        intCate: $(this).attr("data-cateid"),
                        intThumb: $(this).attr("data-numberthumb"),
                        intPage: parseInt($(this).attr("data-page")) - 1,
                        article_id: artical_id,
                        offset: $(this).attr("data-offset"),
                        intLimit: limit
                    }
                    // post data
                    $.post(base_url + '/detail/othernews', param, function (data) {
                        box.find(".show_other_news").html(data.html);
                        $("#load").hide();
                    }, "json");
                });
            },
            loadPopup: function () {
                $("#backgroundPopup").css({ opacity: "0.7" });
                $("#backgroundPopup").fadeIn("slow");
                $("#popup_email").fadeIn("slow");
                $("#popup_email #pop_email #sender_email").focus();
            },
            disablePopup: function () {
                $("#backgroundPopup").fadeOut("slow");
                $("#popup_email").fadeOut("slow");
            },
            submitEmail: function () {
                //alert(1);
                var link = window.location.href;
                $("#url").val(link);

                var a = RegExp(/^(("[\w-+\s]+")|([\w-+]+(?:\.[\w-+]+)*)|("[\w-+\s]+")([\w-+]+(?:\.[\w-+]+)*))(@((?:[\w-+]+\.)*\w[\w-+]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][\d]\.|1[\d]{2}\.|[\d]{1,2}\.))((25[0-5]|2[0-4][\d]|1[\d]{2}|[\d]{1,2})\.){2}(25[0-5]|2[0-4][\d]|1[\d]{2}|[\d]{1,2})\]?$)/i), b = $.trim($("#sender_email").val());
                if ("" == b) return alert("Nh\u1eadp Email c\u1ee7a b\u1ea1n"), $("#sender_email").focus(), !1; if (!a.test(b)) return alert("Email c\u1ee7a b\u1ea1n kh\u00f4ng h\u1ee3p l\u1ec7"), $("#sender_email").focus(), !1;
                var c = $("#sender_name").val();
                if ("" == c) return alert("Nh\u1eadp t\u00ean c\u1ee7a b\u1ea1n"), $("#sender_name").focus(), !1;
                var d = $("#receiver_mail").val();
                if ("" == d) return alert("Nh\u1eadp email g\u1eedi \u0111\u1ebfn"), $("#receiver_mail").focus(), !1;
                for (var e = d.split(";"), f = !0, g = 0; g < e.length; g++) f = f && a.test($.trim(e[g]));
                if (!f) return alert("Email g\u1eedi \u0111\u1ebfn kh\u00f4ng h\u1ee3p l\u1ec7"), $("#receiver_mail").focus(), !1;
                a = $("#title_email").val();
                if ("" == a) return alert("Nh\u1eadp ti\u00eau \u0111\u1ec1 g\u1eedi mail"), $("#title_email").focus(), !1;
                e = $("#message_mail");
                f = $.trim(this.strip_tags(e.val()));
                e.val(f);
                news_detail.disablePopup();
                $.ajax({
                    type: "POST",
                    url: base_url + "/detail/sendmail",
                    data: {
                        sender_name: c,
                        email_user: b,
                        title_email: a,
                        receiver_mail: d,
                        message_mail: f,
                        url: $("#url").val()
                    },
                    beforeSend: function () {
                    },
                    success: function (a) {
                        if ($.trim(a) == 'done') {
                            //alert('Gửi bài viết qua Email thành công. Cảm ơn bạn.');
                        } else {
                            alert('Không gửi được email. Xin vui lòng thử lại sau.');
                            news_detail.disablePopup();
                        }
                    }
                });

            },
            strip_tags: function (a, b) {
                b = (((b || "") + "").toLowerCase().match(/<[a-z][a-z0-9]*>/g) || []).join(""); return a.replace(/\x3c!--[\s\S]*?--\x3e|<\?(?:php)?[\s\S]*?\?>/gi, "").replace(/<\/?([a-z][a-z0-9]*)\b[^>]*>/gi, function (a, d) { return -1 < b.indexOf("<" + d.toLowerCase() + ">") ? a : "" })
            }
        }
    </script>
    <asp:Panel ID="pnNoiDung" runat="server">
        <div id="iconTop">
            <div>
                <img style="border-width: 0px;" src="../../../Images/dltn/caydua.png" id="ctl00_ContentPlaceHolder1_TourHotContent_icon0">
                <div style="margin-top: 15px; color: Red; font-weight: bold">
                    <a href="." class="link" id="ctl00_ContentPlaceHolder1_TourHotContent_linkHomePage"
                        style="text-decoration: none;">TRANG CHỦ >> </a>
                    <asp:HyperLink ID="linkLoaiCM" runat="server" CssClass="link">
                        <asp:Label ID="lbTenLoaiCM" runat="server" /></asp:HyperLink>
                    <asp:HyperLink ID="linkSubCM" runat="server" CssClass="link">
                        >>
                        <asp:Label ID="lbTenSubCM" runat="server" /></asp:HyperLink>
                </div>
                <p>
                    <asp:Label ID="lbNgaythang" runat="server"></asp:Label>
                </p>
            </div>
        </div>
        <div class="link">
            <div class="itemIcon">
                <asp:ImageButton ID="ImageButton3" CausesValidation="false" ImageUrl="~/Images/dltn/MayIn.png"
                    runat="server" ToolTip="Thực hiện chức năng IN" OnClick="cmdIn_Click" />
            </div>
            <div class="itemIcon">
                <font style="cursor: pointer;" onclick="news_detail.loadPopup()" title='Gửi qua Email'>
                    <asp:Image ID="Image4" runat="server" ImageUrl="~/Images/dltn/Email.png" />
                </font>&nbsp
            </div>
            <%--<div class="itemIcon">
                <a style='padding: 0 5px;' target="_blank" href='<%= "http://linkhay.com/submit?link_url=" + Common.sPathUpLienKet + HttpContext.Current.Request.Url.AbsolutePath.ToString()%>'
                    title='Chia sẻ lên LinkHay.com'>
                    <asp:Image ID="Image3" runat="server" ImageUrl="~/Images/dltn/LinkHay.png" />
                </a>
            </div>--%>
            <div class="itemIcon">
                <a style='padding: 0 5px;' target="_blank" href='<%= "http://www.twitter.com/share?url=" + Common.sPathUpLienKet + HttpContext.Current.Request.Url.AbsolutePath.ToString()%>'
                    title='Chia sẻ lên Twitter'>
                    <asp:Image ID="ImageButton1" runat="server" ImageUrl="~/Images/dltn/twisterMini.png" />
                </a>
            </div>
            <div class="itemIcon">
                <a style='padding: 0 5px;' target="_blank" href='<%= "http://www.facebook.com/share.php?u=" + Common.sPathUpLienKet + HttpContext.Current.Request.Url.AbsolutePath.ToString()%>'
                    title='Chia sẻ lên Facebook'>
                    <asp:Image ID="ImageButton2" runat="server" ImageUrl="~/Images/dltn/facebookMini.png" />
                </a>
            </div>
            <%--<div class="itemIcon">
                <a style='padding: 0 5px;' target="_blank" href='<%= "http://plugins.banbe.net/share/post?href=" + Common.sPathUpLienKet + HttpContext.Current.Request.Url.AbsolutePath.ToString()%>'
                    title='Chia sẻ lên plugins'>
                    <asp:Image ID="Image1" runat="server" ImageUrl="~/Images/dltn/BanBe.png" />
                </a>
            </div>--%>
        </div>
        <div style="clear: both; margin: 0px;">
        </div>
        <div class="chuyenmuc-content">
            <div style="text-align: left; line-height: 180%; font-size: 10pt;"> 
                <h2 style="font-size: 11pt; color: #CC3300;">
                    <asp:Label ID="lblTieuDe" runat="server"></asp:Label></h2>
                <span class="tt-tintuc-cmnd"><b>Nguồn :</b>
                    <asp:Label ID="lblNguon" runat="server"></asp:Label>
                    <b>Lượt xem:</b>
                    <asp:Label ID="lblLuotxem" runat="server"></asp:Label>
                </span>
                <asp:HyperLink ID="linkChuyenMuc" runat="server" NavigateUrl=''>
                    <asp:Image ID="imageanhchuyenmuc" Visible="False" runat="server" ImageUrl='' CssClass="img-center" />
                </asp:HyperLink>
                <p>
                    <asp:Label ID="lblNoidung" runat="server"></asp:Label>
                </p>
            </div>
        </div>
    </asp:Panel>
    <div class="tags" style="clear: both">
        <div class="tag-ico">
            <img src="../../../Images/tags.png" />
        </div>
        <div class="all-tag">
            <asp:Literal ID="ltrTags" runat="server"></asp:Literal>
            <%--<asp:DataList runat="server" ID="ltrTags">
                <ItemTemplate>
                    <asp:HyperLink runat="server" ID="tag01">
                        
                    </asp:HyperLink>
                </ItemTemplate>
            </asp:DataList> --%>
        </div>
    </div>
    <br />
    <div style="clear: both" class="comment-baiviet">
        <div class="fb-like" data-href="<%= Common.sPathUpLienKet+ HttpContext.Current.Request.Url.AbsolutePath.ToString()%>"
            data-width="640" data-show-faces="true" data-send="true">
        </div>
        <div class="fb-comments" data-href='<%= Common.sPathUpLienKet+ HttpContext.Current.Request.Url.AbsolutePath.ToString()%>'
            data-width="640" data-num-posts="10">
        </div>
    </div>
    <div style="clear: both" class="tin-lien-quan">
        <div>
            <span>Tin liên quan</span>
        </div>
        <hr />
        <div>
            <ul>
                <asp:DataList ID="dlChuyenmucLienquan" runat="server" RepeatColumns="1" RepeatDirection="Horizontal">
                    <ItemTemplate>
                        <li>
                            <asp:HyperLink ID="linkTieudeLienquan" runat="server" NavigateUrl='<%# "~/" + "ChuyenMuc/" + Eval("Id") + "/" + Eval("IdSubChuyenMuc") + "/" + GetTieuDe(Eval("TieuDe")) + ".aspx" %>'>
                                <%# Eval("TieuDe") %>
                            </asp:HyperLink>
                        </li>
                    </ItemTemplate>
                </asp:DataList>
            </ul>
        </div>
    </div>
</asp:Content>
